package com.mr.service.api;



import com.mr.service.pojo.CategoryEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("category")
public interface CategoryApi {

    @GetMapping("list")
    public ResponseEntity<List<CategoryEntity>> getCateList(
            @RequestParam(value = "pid",defaultValue = "0") Long pid);


    @PostMapping("post")
    public void save(@RequestBody CategoryEntity entity);

    //删除
    @DeleteMapping("delete")
    public  ResponseEntity delCate(@RequestParam(value = "id") Long id);

    @GetMapping("cateNames")
    public  List<String> queryCateNameByIds(@RequestParam("ids") List<Long> ids);
    //查询品牌下的分类
    @GetMapping("queryCategoryByBrandId/{bid}")
    public ResponseEntity<List<CategoryEntity>> queryCategoryByBrandId(@PathVariable("bid") Long bid);

    @PutMapping("put")
    public void update(@RequestBody CategoryEntity entity);

    @GetMapping("queryCateLisByIds")
    public List<CategoryEntity> queryCateLisByIds(@RequestParam("ids") List ids);
}
